#!/usr/bin/env python3

import sys
import os


def parse_conf(_f, _num):
    _ret = dict()
    i=0
    with open(_f, 'r') as _fd:
        for _l in _fd.readlines():
            _ll = _l.strip()

            # skip null lines
            if not _ll:
                continue

            # skip comment lines
            if _ll.find("#") == 0:
                continue

            # skip not ave lines
            if _ll.find("ave latency") == 0:
                continue
            if i < int(_num):
                i=i+1
                continue

            # get num
            eidx = _ll.find("num:")
            if eidx == -1 and i == int(_num):
                return 
            tmpidx = _ll.find(", ave")
            key = _ll[eidx + 4:tmpidx].strip()
            print("{:<40}".format(key))
            return

if __name__ == "__main__":
    _f1 = sys.argv[1];
    _num = sys.argv[2];

    _kv1 = parse_conf(_f1, _num);
